package cz.muni.fi.pa165.rentalofconstructionmachinery.service;

import cz.muni.fi.pa165.rentalofconstructionmachinery.dto.MachineDTO;
import cz.muni.fi.pa165.rentalofconstructionmachinery.dto.RevisionDTO;
import java.util.List;

/**
 *
 * @author Adam Zmrzlý
 * @version Miura (20121101)
 */
public interface RevisionService {
    
    /*
     * Creates a new revision. Revision and revision.machine cannot be null.
     * @param revision A revision to be created.
     */
    public void create(RevisionDTO revision);
    /*
     * Deletes a revision. Revision cannot be null.
     * @param revision A revision to be deleted.
     */
    public void delete(RevisionDTO revision);
    /*
     * Updates a revision. Revision and revision.machine cannot be null.
     * @param revision A revision to be updated.
     */
    public void update(RevisionDTO revision);

    /*
     * Retrieves all revisions.
     * @return List of all revisions.
     */
    public List<RevisionDTO> getAll();
    /*
     * Retrieves a specific revision.
     * @param id An id of revision to retrieve.
     * @return A revision with given id.
     */
    public RevisionDTO getRevisionById(Long id);
    /*
     * Retrieves the last revision of a given machine. Machine cannot be null.
     * @param machine A machine for which retrieve the last revision.
     * @return Last revision of a given machine.
     */
    public RevisionDTO getLastRevisionOfMachine(MachineDTO machine);
    /*
     * Retrieves all revisions of a given machine. Machine cannot be null.
     * @param machine A machine for which retrieve all its revisions.
     * @return List of all revisions of a given machine.
     */
    public List<RevisionDTO> getAllRevisionsOfMachine(MachineDTO machine);
}
